import request from "@/utils/request";

/**
* omss商店数据
*
* @param queryParams
*/
export function getOdsOmsShopPage(queryParams) {
    return request({
        url: '/api/v1/odsOmsShop/page',
        method: 'get',
        params: queryParams
    });
}


/**
* 获取omss商店表单数据
*
* @param queryParams
*/
export function getOdsOmsShopForm(id) {
    return request({
        url: '/api/v1/odsOmsShop/' + id + '/form',
        method: 'get'
    });
}

/**
* 保存omss商店
*
* @param data
*/
export function saveOdsOmsShop(data) {
    return request({
        url: "/api/v1/odsOmsShop",
        method: "post",
        data: data,
    });
}

/**
* 删除omss商店
*
* @param ids
*/
export function deleteOdsOmsShop(ids) {
    return request({
        url: '/api/v1/odsOmsShop/' + ids,
        method: 'delete'
    });
}

/**
* 导入omss商店
*
* @param file
*/
export function importOdsOmsShop(file: any) {
    const formData = new FormData();
    formData.append('file', file);
    return request({
        url: '/api/v1/odsOmsShop/odsOmsShopImport',
        method: 'post',
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}

/**
* 导出omss商店
*
* @param ids
* @returns
*/
export function exportOdsOmsShop(ids: any) {
    return request({
        url: '/api/v1/odsOmsShop/_export?ids='+ids,
        method: 'get',
        responseType: 'arraybuffer'
    });
}